<?php

//UMA new
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInputOptionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('input_options', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('option_name', 128)->comment('選択項目名');
            $table->string('option', 128)->comment('選択値');
            $table->decimal('rate', 4, 2)->comment('スコアリング値');
            $table->unsignedBigInteger('input_item_id')->comment('質問項目ID');
            $table->timestamps();
            $table->foreign('input_item_id')->references('id')->on('input_items');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('input_options');
    }
}
